﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
          @if (false)
   {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
   }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

         <script>
             if (top.boardtop) {
                 top.boardtop.head_txt.innerText = "信息考核基分定义";
                 top.boardtop.showChooseYear(@ViewData["dqyear"], @ViewData["maxyear"], @ViewData["minyear"], rootPath + "/Admin/ChkInfoStd?fYear=");
             }
    </script>
    <script>
        $(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                if (hdjsAlert == "操作成功") {
                    alert(hdjsAlert);
                }
                else {
                    if (hdjsAlert != '') {
                        alert(hdjsAlert);
                    }
                }
            }
        });

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        form1.submit();
                        break;
                    }
            }
        }
                //textbox获得焦点时执行的方法
        function tbFocus(obj) {
            var tbValue = obj.value;
            $('#tbOldValue').val(tbValue);
        }


        function ValueSum(rowSumName, colSumName, tbName, obj,type) {
            var oldValue = $('#tbOldValue').val(); //获取旧的数据值

            var tbValue = obj.value; //获取数据的值

            var regiex = /^-?([0-9]+(.[0-9]{1,2})?$)/;
            if (!regiex.test(tbValue)) {
                alert("请输入数字,最多两位小数!");
                obj.value = oldValue;
                obj.focus();
            } else {
                var newValue = tbValue - oldValue;

                if (tbName != "") {
                    var tbNameValue = parseFloat($('#' + tbName).text());
                    $('#' + tbName).text((Math.round((tbNameValue + newValue) * 100) / 100).toFixed(2));
                    var qjAllSumValue = parseFloat($('#qjAllSum').text());
                    $('#qjAllSum').text((Math.round((qjAllSumValue + newValue) * 100) / 100).toFixed(2));
                }


                if (rowSumName != "") {
                    var rowSumValue = parseFloat($('#' + rowSumName).text());
                    $('#' + rowSumName).text((Math.round((rowSumValue + newValue) * 100) / 100).toFixed(2));
                }

                if (rowSumName != "") {
                    var colSumValue = parseFloat($('#' + colSumName).text());
                    $('#' + colSumName).text((Math.round((colSumValue + newValue) * 100) / 100).toFixed(2));
                }

                if (type == "AllSum") {
                    var allSum = parseFloat($("#AllSum").text());
                    $("#AllSum").text((Math.round((allSum + newValue) * 100) / 100).toFixed(2));
                }
            }

        }

        function clearNoNum(obj) {
            //先把非数字的都替换掉，除了数字和.
            obj.value = obj.value.replace(/[^\d.]/g, "");
            //必须保证第一个为数字而不是.
            obj.value = obj.value.replace(/^\./g, "");
            //保证只有出现一个.而没有多个.
            obj.value = obj.value.replace(/\.{2,}/g, ".");
            //保证.只出现一次，而不能出现两次以上
            obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
            if (obj.value == "") {
                obj.value = 0;
            }
        }

    </script>
</head>
<body  style="	font-size: 12px;">
@using (Html.BeginForm("Save", "ChkInfoStd", FormMethod.Post, new { id = "form1" }))
{
    
     <div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnSave";
           item.Text = "保存";
           item.ClientEnabled = true;
           item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

       });
       settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()
   </div>
    <div style=" width:100%; text-align:center">
    <br />
        @Html.Raw(ViewData["Table"].ToString())
            <input type="hidden" id="tbOldValue"/>
    </div> 
     @Html.Hidden("hdyear", ViewData["dqyear"])  
     @Html.Hidden("hdjsAlert", ViewData["jsAlert"])  
}      
</body>
</html>
